<template>
  <div style="height: 400px;" id="charts2" ref="charts2">
  </div>
</template>
<script>
  export default {
    mounted() {
      this.drawchart()
    },
    methods: {
      drawchart() {
        var option = {
          tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b}: {c} ({d}%)"
          },
          legend: {
            orient: 'vertical',
            x: 'left',
            data:['胰岛素使用','足溃烂','胰岛移植','关联性研究','二甲双孤','胃病患者','无创血糖监测']
          },
          series: [
            {
              name:'访问来源',
              type:'pie',
              selectedMode: 'single',
              radius: [0, '30%'],

              label: {
                normal: {
                  position: 'inner'
                }
              },
              labelLine: {
                normal: {
                  show: false
                }
              },
              data:[
                {value:335, name:'基础研究', selected:true},
                {value:679, name:'临床研究'},
              ]
            },
            {
              name:'访问来源',
              type:'pie',
              radius: ['55%', '70%'],
              data:[
                {value:335, name:'胰岛素使用'},
                {value:310, name:'足溃烂'},
                {value:234, name:'胰岛移植'},
                {value:135, name:'关联性研究'},
                {value:1048, name:'二甲双孤'},
                {value:251, name:'胃病患者'},
                {value:147, name:'无创血糖监测'}
              ]
            }
          ]
        };
        var mycharts = this.$echarts.init(this.$refs.charts2)
        mycharts.setOption(option)
      }
    }
  }
</script>
<style></style>
